package com.shop.dao;

import java.util.List;

import com.shop.domain.Comment;
import com.shop.domain.Goods;

/**
 * 
 * @author wenjuanhenxing
 * @version V1.0 GoodsDao.java 2016-2-10 下午5:56:30
 */
public interface GoodsDao {
	boolean addGoods(Goods goods);

	boolean updateImage(Goods goods);

	Goods getGoodsById(Long id);

	List<Goods> getAllGoods();

	/**
	 * 
	 * @param startRow
	 *            开始行数
	 * @param rowsPerPage
	 *            记录集的大小
	 * @return
	 */
	List<Goods> getGoodsByPage(Integer startRow, Integer rowsPerPage);

	List<Goods> getGoodsByLargeCategory(Integer largeCategory);

	List<Goods> getGoodsBySmallCategory(Integer smallCategory);

	/**
	 * 根据价格区间[low, high]查询商品
	 * 
	 * @param low
	 * @param high
	 * @return 无符合条件返回null
	 */
	List<Goods> getGoodsByPrice(double low, double high);

	List<Comment> getCommentsByGoodsId(Long id);

	boolean updateName(Goods goods);

	boolean updateLargeCategory(Goods goods);

	boolean updateSmallCategory(Goods goods);

	boolean updatePrice(Goods goods);

	boolean updateDegree(Goods goods);

	boolean updateStock(Goods goods);

	boolean updateRecentUpdate(Goods goods);

	boolean updateOnlineStatus(Goods goods);

	boolean updateCollectCnt(Goods goods);

	boolean updateTransactionMode(Goods goods);

	boolean updateTransactionAddress(Goods goods);

	boolean updateDescription(Goods goods);

	List<Goods> getGoodsByCategoryId(Integer categoryId);

	List<Goods> getGoodsByNameLike(String name);
}
